USE [BBI_MAPPING]
GO

/****** Object:  View [BwAppMap].[v_esplodi_s02_1]    Script Date: 10/14/2012 00:52:47 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE VIEW [BwAppMap].[v_esplodi_s02_1]
AS
SELECT     TOP (100) PERCENT S1.ID_MAPPING, S1.VALUE_SOURCE AS S1, S2.VALUE_SOURCE AS S2, S1.APPL_ID, S1.ID_TYPE_MAPPING
FROM         BBI_MAPPING.DATA_DWH_MODEL_ANA_MAPPING AS S1 INNER JOIN
                      BBI_MAPPING.DATA_DWH_MODEL_ANA_MAPPING AS S2 ON S1.ID_MAPPING = S2.ID_MAPPING AND S1.ID_TYPE_MAPPING = S2.ID_TYPE_MAPPING AND 
                      S1.APPL_ID = S2.APPL_ID
WHERE     (S1.FIELD_SOURCE = 'S1') AND (S2.FIELD_SOURCE = 'S2') AND (S1.ID_TYPE_MAPPING = - 1)
GROUP BY S1.ID_MAPPING, S1.VALUE_SOURCE, S2.VALUE_SOURCE, S1.APPL_ID, S1.ID_TYPE_MAPPING

GO

EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[29] 4[49] 2[4] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = -192
         Left = 0
      End
      Begin Tables = 
         Begin Table = "S1"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 114
               Right = 228
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "S2"
            Begin Extent = 
               Top = 6
               Left = 266
               Bottom = 114
               Right = 456
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 9
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 12
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'BwAppMap', @level1type=N'VIEW',@level1name=N'v_esplodi_s02_1'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1 , @level0type=N'SCHEMA',@level0name=N'BwAppMap', @level1type=N'VIEW',@level1name=N'v_esplodi_s02_1'
GO

/****** Object:  View [BwAppMap].[v_esplodi_s02_1_p]    Script Date: 10/14/2012 00:52:47 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO


CREATE VIEW [BwAppMap].[v_esplodi_s02_1_p]
AS
SELECT     TOP (100) PERCENT S1.ID_MAPPING, S1.VALUE_SOURCE AS S1, S2.VALUE_SOURCE AS S2, S1.APPL_ID, S1.ID_TYPE_MAPPING
FROM         BBI_MAPPING.DATA_DWH_MODEL_ANA_MAPPING AS S1 INNER JOIN
                      BBI_MAPPING.DATA_DWH_MODEL_ANA_MAPPING AS S2 ON S1.ID_MAPPING = S2.ID_MAPPING AND S1.ID_TYPE_MAPPING = S2.ID_TYPE_MAPPING AND 
                      S1.APPL_ID = S2.APPL_ID
WHERE     (S1.FIELD_SOURCE = 'S1') AND (S2.FIELD_SOURCE = 'S2') AND (S1.ID_TYPE_MAPPING = - 1)
GROUP BY S1.ID_MAPPING, S1.VALUE_SOURCE, S2.VALUE_SOURCE, S1.APPL_ID, S1.ID_TYPE_MAPPING


GO

/****** Object:  View [BwAppMap].[v_esplodi_s02_2_p]    Script Date: 10/14/2012 00:52:47 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE VIEW [BwAppMap].[v_esplodi_s02_2_p]
AS
SELECT     _tmp_ALL.S1, _tmp_ALL.S2, v_esp.ID_MAPPING, _tmp_ALL.T
FROM         BwAppMap.v_esplodi_s02_1_p AS v_esp RIGHT OUTER JOIN
                      BwAppMap.tmp_ALL_element AS _tmp_ALL ON v_esp.S1 = _tmp_ALL.S1 AND v_esp.S2 = _tmp_ALL.S2

GO

EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "_tmp_ALL"
            Begin Extent = 
               Top = 0
               Left = 375
               Bottom = 174
               Right = 549
            End
            DisplayFlags = 280
            TopColumn = 1
         End
         Begin Table = "v_esp"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 114
               Right = 212
            End
            DisplayFlags = 280
            TopColumn = 1
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'BwAppMap', @level1type=N'VIEW',@level1name=N'v_esplodi_s02_2_p'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1 , @level0type=N'SCHEMA',@level0name=N'BwAppMap', @level1type=N'VIEW',@level1name=N'v_esplodi_s02_2_p'
GO

/****** Object:  View [BwAppMap].[v_esplodi_s03_1]    Script Date: 10/14/2012 00:52:47 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE VIEW [BwAppMap].[v_esplodi_s03_1]
AS
SELECT     TOP (100) PERCENT S1.ID_MAPPING, S1.VALUE_SOURCE AS S1, S2.VALUE_SOURCE AS S2, S3.VALUE_SOURCE AS S3, S1.APPL_ID, S1.ID_TYPE_MAPPING
FROM         BBI_MAPPING.DATA_DWH_MODEL_ANA_MAPPING AS S1 INNER JOIN
                      BBI_MAPPING.DATA_DWH_MODEL_ANA_MAPPING AS S2 ON S1.ID_MAPPING = S2.ID_MAPPING AND S1.ID_TYPE_MAPPING = S2.ID_TYPE_MAPPING AND 
                      S1.APPL_ID = S2.APPL_ID INNER JOIN
                      BBI_MAPPING.DATA_DWH_MODEL_ANA_MAPPING AS S3 ON S2.APPL_ID = S3.APPL_ID AND S2.ID_TYPE_MAPPING = S3.ID_TYPE_MAPPING AND 
                      S2.ID_MAPPING = S3.ID_MAPPING
WHERE     (S1.FIELD_SOURCE = 'S1') AND (S2.FIELD_SOURCE = 'S2') AND (S3.FIELD_SOURCE = 'S3') AND (S1.ID_TYPE_MAPPING = - 1)
GROUP BY S1.ID_MAPPING, S1.VALUE_SOURCE, S2.VALUE_SOURCE, S3.VALUE_SOURCE, S1.APPL_ID, S1.ID_TYPE_MAPPING

GO

EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "S1"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 114
               Right = 228
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "S2"
            Begin Extent = 
               Top = 6
               Left = 266
               Bottom = 114
               Right = 456
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "S3"
            Begin Extent = 
               Top = 114
               Left = 38
               Bottom = 222
               Right = 228
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 12
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'BwAppMap', @level1type=N'VIEW',@level1name=N'v_esplodi_s03_1'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1 , @level0type=N'SCHEMA',@level0name=N'BwAppMap', @level1type=N'VIEW',@level1name=N'v_esplodi_s03_1'
GO

/****** Object:  View [BwAppMap].[v_esplodi_s03_1_p]    Script Date: 10/14/2012 00:52:47 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

 create VIEW [BwAppMap].[v_esplodi_s03_1_p]
 AS 
SELECT     TOP (100) PERCENT S1.ID_MAPPING, S1.VALUE_SOURCE AS S1, S2.VALUE_SOURCE AS S2, S3.VALUE_SOURCE AS S3, S1.APPL_ID, S1.ID_TYPE_MAPPING
FROM         BBI_MAPPING.DATA_DWH_MODEL_ANA_MAPPING AS S1 INNER JOIN
                      BBI_MAPPING.DATA_DWH_MODEL_ANA_MAPPING AS S2 ON S1.ID_MAPPING = S2.ID_MAPPING AND S1.ID_TYPE_MAPPING = S2.ID_TYPE_MAPPING AND 
                      S1.APPL_ID = S2.APPL_ID INNER JOIN
                      BBI_MAPPING.DATA_DWH_MODEL_ANA_MAPPING AS S3 ON S2.APPL_ID = S3.APPL_ID AND S2.ID_TYPE_MAPPING = S3.ID_TYPE_MAPPING AND 
                      S2.ID_MAPPING = S3.ID_MAPPING
WHERE     (S1.FIELD_SOURCE = 'i_ID_CONTO_CONTAB') AND (S2.FIELD_SOURCE = 'i_ID_SEGNO_SALDO') AND (S3.FIELD_SOURCE = 'i_ID_UNIT') AND (S1.ID_TYPE_MAPPING = 11)
GROUP BY S1.ID_MAPPING, S1.VALUE_SOURCE, S2.VALUE_SOURCE, S3.VALUE_SOURCE, S1.APPL_ID, S1.ID_TYPE_MAPPING
GO

/****** Object:  View [BwAppMap].[v_esplodi_s03_2_p]    Script Date: 10/14/2012 00:52:47 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO


CREATE VIEW [BwAppMap].[v_esplodi_s03_2_p]
AS
SELECT     _tmp_ALL.S1, _tmp_ALL.S2, _tmp_ALL.S3, v_esp.ID_MAPPING, _tmp_ALL.T
FROM         BwAppMap.v_esplodi_s03_1_p AS v_esp RIGHT OUTER JOIN
                      BwAppMap.tmp_ALL_element AS _tmp_ALL ON v_esp.S1 = _tmp_ALL.S1 AND v_esp.S2 = _tmp_ALL.S2 AND v_esp.S3 = _tmp_ALL.S3


GO

/****** Object:  View [BwAppMap].[v_esplodi_s04_1]    Script Date: 10/14/2012 00:52:47 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE VIEW [BwAppMap].[v_esplodi_s04_1]
AS
SELECT     TOP (100) PERCENT S1.ID_MAPPING, S1.VALUE_SOURCE AS S1, S2.VALUE_SOURCE AS S2, S3.VALUE_SOURCE AS S3, S4.VALUE_SOURCE AS S4, S1.APPL_ID, 
                      S1.ID_TYPE_MAPPING
FROM         BBI_MAPPING.DATA_DWH_MODEL_ANA_MAPPING AS S1 INNER JOIN
                      BBI_MAPPING.DATA_DWH_MODEL_ANA_MAPPING AS S2 ON S1.ID_MAPPING = S2.ID_MAPPING AND S1.ID_TYPE_MAPPING = S2.ID_TYPE_MAPPING AND 
                      S1.APPL_ID = S2.APPL_ID INNER JOIN
                      BBI_MAPPING.DATA_DWH_MODEL_ANA_MAPPING AS S3 ON S2.APPL_ID = S3.APPL_ID AND S2.ID_TYPE_MAPPING = S3.ID_TYPE_MAPPING AND 
                      S2.ID_MAPPING = S3.ID_MAPPING INNER JOIN
                      BBI_MAPPING.DATA_DWH_MODEL_ANA_MAPPING AS S4 ON S3.APPL_ID = S4.APPL_ID AND S3.ID_TYPE_MAPPING = S4.ID_TYPE_MAPPING AND 
                      S3.ID_MAPPING = S4.ID_MAPPING
WHERE     (S1.FIELD_SOURCE = 'S1') AND (S2.FIELD_SOURCE = 'S2') AND (S3.FIELD_SOURCE = 'S3') AND (S4.FIELD_SOURCE = 'S4') AND (S1.ID_TYPE_MAPPING = - 1)
GROUP BY S1.ID_MAPPING, S1.VALUE_SOURCE, S2.VALUE_SOURCE, S3.VALUE_SOURCE, S1.APPL_ID, S1.ID_TYPE_MAPPING, S4.VALUE_SOURCE

GO

EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1[50] 4[25] 3) )"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1[56] 3) )"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1[46] 4) )"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = -192
         Left = 0
      End
      Begin Tables = 
         Begin Table = "S1"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 204
               Right = 228
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "S2"
            Begin Extent = 
               Top = 0
               Left = 373
               Bottom = 253
               Right = 563
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "S3"
            Begin Extent = 
               Top = 218
               Left = 8
               Bottom = 371
               Right = 198
            End
            DisplayFlags = 280
            TopColumn = 1
         End
         Begin Table = "S4"
            Begin Extent = 
               Top = 256
               Left = 379
               Bottom = 364
               Right = 569
            End
            DisplayFlags = 280
            TopColumn = 3
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 9
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 12
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'BwAppMap', @level1type=N'VIEW',@level1name=N'v_esplodi_s04_1'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1 , @level0type=N'SCHEMA',@level0name=N'BwAppMap', @level1type=N'VIEW',@level1name=N'v_esplodi_s04_1'
GO

/****** Object:  View [BwAppMap].[v_esplodi_s04_1_p]    Script Date: 10/14/2012 00:52:47 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

 create VIEW [BwAppMap].[v_esplodi_s04_1_p]
 AS 
SELECT     TOP (100) PERCENT S1.ID_MAPPING, S1.VALUE_SOURCE AS S1, S2.VALUE_SOURCE AS S2, S3.VALUE_SOURCE AS S3, S4.VALUE_SOURCE AS S4, S1.APPL_ID, 
                      S1.ID_TYPE_MAPPING
FROM         BBI_MAPPING.DATA_DWH_MODEL_ANA_MAPPING AS S1 INNER JOIN
                      BBI_MAPPING.DATA_DWH_MODEL_ANA_MAPPING AS S2 ON S1.ID_MAPPING = S2.ID_MAPPING AND S1.ID_TYPE_MAPPING = S2.ID_TYPE_MAPPING AND 
                      S1.APPL_ID = S2.APPL_ID INNER JOIN
                      BBI_MAPPING.DATA_DWH_MODEL_ANA_MAPPING AS S3 ON S2.APPL_ID = S3.APPL_ID AND S2.ID_TYPE_MAPPING = S3.ID_TYPE_MAPPING AND 
                      S2.ID_MAPPING = S3.ID_MAPPING INNER JOIN
                      BBI_MAPPING.DATA_DWH_MODEL_ANA_MAPPING AS S4 ON S3.APPL_ID = S4.APPL_ID AND S3.ID_TYPE_MAPPING = S4.ID_TYPE_MAPPING AND 
                      S3.ID_MAPPING = S4.ID_MAPPING
WHERE     (S1.FIELD_SOURCE = 'CDC') AND (S2.FIELD_SOURCE = 'CLI') AND (S3.FIELD_SOURCE = 'LPD') AND (S4.FIELD_SOURCE = 'PDC') AND (S1.ID_TYPE_MAPPING = 3)
GROUP BY S1.ID_MAPPING, S1.VALUE_SOURCE, S2.VALUE_SOURCE, S3.VALUE_SOURCE, S1.APPL_ID, S1.ID_TYPE_MAPPING, S4.VALUE_SOURCE

GO

/****** Object:  View [BwAppMap].[v_esplodi_s04_2_p]    Script Date: 10/14/2012 00:52:47 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE VIEW [BwAppMap].[v_esplodi_s04_2_p]
AS
SELECT     _tmp_ALL.S1, _tmp_ALL.S2, _tmp_ALL.S3, _tmp_ALL.S4, v_esp.ID_MAPPING, _tmp_ALL.T
FROM         BwAppMap.v_esplodi_s04_1_p AS v_esp RIGHT OUTER JOIN
                      BwAppMap.tmp_ALL_element AS _tmp_ALL ON v_esp.S4 = _tmp_ALL.S4 AND v_esp.S1 = _tmp_ALL.S1 AND v_esp.S2 = _tmp_ALL.S2 AND v_esp.S3 = _tmp_ALL.S3

GO

EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[27] 4[35] 2[21] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "_tmp_ALL"
            Begin Extent = 
               Top = 13
               Left = 369
               Bottom = 182
               Right = 543
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "v_esp"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 165
               Right = 212
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'BwAppMap', @level1type=N'VIEW',@level1name=N'v_esplodi_s04_2_p'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1 , @level0type=N'SCHEMA',@level0name=N'BwAppMap', @level1type=N'VIEW',@level1name=N'v_esplodi_s04_2_p'
GO

/****** Object:  View [BwAppMap].[v_esplodi_s05_1]    Script Date: 10/14/2012 00:52:47 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE VIEW [BwAppMap].[v_esplodi_s05_1]
AS
SELECT     TOP (100) PERCENT S1.ID_MAPPING, S1.VALUE_SOURCE AS S1, S2.VALUE_SOURCE AS S2, S3.VALUE_SOURCE AS S3, S4.VALUE_SOURCE AS S4, 
                      S5.VALUE_SOURCE AS S5, S1.APPL_ID, S1.ID_TYPE_MAPPING
FROM         BBI_MAPPING.DATA_DWH_MODEL_ANA_MAPPING AS S1 INNER JOIN
                      BBI_MAPPING.DATA_DWH_MODEL_ANA_MAPPING AS S2 ON S1.ID_MAPPING = S2.ID_MAPPING AND S1.ID_TYPE_MAPPING = S2.ID_TYPE_MAPPING AND 
                      S1.APPL_ID = S2.APPL_ID INNER JOIN
                      BBI_MAPPING.DATA_DWH_MODEL_ANA_MAPPING AS S3 ON S2.APPL_ID = S3.APPL_ID AND S2.ID_TYPE_MAPPING = S3.ID_TYPE_MAPPING AND 
                      S2.ID_MAPPING = S3.ID_MAPPING INNER JOIN
                      BBI_MAPPING.DATA_DWH_MODEL_ANA_MAPPING AS S4 ON S3.APPL_ID = S4.APPL_ID AND S3.ID_TYPE_MAPPING = S4.ID_TYPE_MAPPING AND 
                      S3.ID_MAPPING = S4.ID_MAPPING INNER JOIN
                      BBI_MAPPING.DATA_DWH_MODEL_ANA_MAPPING AS S5 ON S4.APPL_ID = S5.APPL_ID AND S4.ID_TYPE_MAPPING = S5.ID_TYPE_MAPPING AND 
                      S4.ID_MAPPING = S5.ID_MAPPING
WHERE     (S1.FIELD_SOURCE = 'S1') AND (S2.FIELD_SOURCE = 'S2') AND (S3.FIELD_SOURCE = 'S3') AND (S4.FIELD_SOURCE = 'S4') AND (S5.FIELD_SOURCE = 'S5') AND 
                      (S1.ID_TYPE_MAPPING = - 1)
GROUP BY S1.ID_MAPPING, S1.VALUE_SOURCE, S2.VALUE_SOURCE, S3.VALUE_SOURCE, S1.APPL_ID, S1.ID_TYPE_MAPPING, S4.VALUE_SOURCE, S5.VALUE_SOURCE

GO

EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1[40] 4[36] 3) )"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1[50] 2[25] 3) )"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4[30] 2[40] 3) )"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1[56] 3) )"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1[75] 4) )"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 12
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "S1"
            Begin Extent = 
               Top = 0
               Left = 469
               Bottom = 108
               Right = 659
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "S2"
            Begin Extent = 
               Top = 26
               Left = 9
               Bottom = 212
               Right = 199
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "S3"
            Begin Extent = 
               Top = 289
               Left = 65
               Bottom = 457
               Right = 255
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "S4"
            Begin Extent = 
               Top = 185
               Left = 356
               Bottom = 381
               Right = 546
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "S5"
            Begin Extent = 
               Top = 113
               Left = 565
               Bottom = 355
               Right = 755
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
      PaneHidden = 
   End
   Begin DataPane = 
      PaneHidden = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 9
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      PaneHidden = 
      Begin ColumnWidths = 12
         Column = ' , @level0type=N'SCHEMA',@level0name=N'BwAppMap', @level1type=N'VIEW',@level1name=N'v_esplodi_s05_1'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane2', @value=N'1920
         Alias = 900
         Table = 1170
         Output = 2100
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'BwAppMap', @level1type=N'VIEW',@level1name=N'v_esplodi_s05_1'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=2 , @level0type=N'SCHEMA',@level0name=N'BwAppMap', @level1type=N'VIEW',@level1name=N'v_esplodi_s05_1'
GO

/****** Object:  View [BwAppMap].[v_esplodi_s05_1_p]    Script Date: 10/14/2012 00:52:47 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO


CREATE VIEW [BwAppMap].[v_esplodi_s05_1_p]
AS
SELECT     TOP (100) PERCENT S1.ID_MAPPING, S1.VALUE_SOURCE AS S1, S2.VALUE_SOURCE AS S2, S3.VALUE_SOURCE AS S3, S4.VALUE_SOURCE AS S4, 
                      S5.VALUE_SOURCE AS S5, S1.APPL_ID, S1.ID_TYPE_MAPPING
FROM         BBI_MAPPING.DATA_DWH_MODEL_ANA_MAPPING AS S1 INNER JOIN
                      BBI_MAPPING.DATA_DWH_MODEL_ANA_MAPPING AS S2 ON S1.ID_MAPPING = S2.ID_MAPPING AND S1.ID_TYPE_MAPPING = S2.ID_TYPE_MAPPING AND 
                      S1.APPL_ID = S2.APPL_ID INNER JOIN
                      BBI_MAPPING.DATA_DWH_MODEL_ANA_MAPPING AS S3 ON S2.APPL_ID = S3.APPL_ID AND S2.ID_TYPE_MAPPING = S3.ID_TYPE_MAPPING AND 
                      S2.ID_MAPPING = S3.ID_MAPPING INNER JOIN
                      BBI_MAPPING.DATA_DWH_MODEL_ANA_MAPPING AS S4 ON S3.APPL_ID = S4.APPL_ID AND S3.ID_TYPE_MAPPING = S4.ID_TYPE_MAPPING AND 
                      S3.ID_MAPPING = S4.ID_MAPPING INNER JOIN
                      BBI_MAPPING.DATA_DWH_MODEL_ANA_MAPPING AS S5 ON S4.APPL_ID = S5.APPL_ID AND S4.ID_TYPE_MAPPING = S5.ID_TYPE_MAPPING AND 
                      S4.ID_MAPPING = S5.ID_MAPPING
WHERE     (S1.FIELD_SOURCE = 'S1') AND (S2.FIELD_SOURCE = 'S2') AND (S3.FIELD_SOURCE = 'S3') AND (S4.FIELD_SOURCE = 'S4') AND (S5.FIELD_SOURCE = 'S5') AND 
                      (S1.ID_TYPE_MAPPING = - 1)
GROUP BY S1.ID_MAPPING, S1.VALUE_SOURCE, S2.VALUE_SOURCE, S3.VALUE_SOURCE, S1.APPL_ID, S1.ID_TYPE_MAPPING, S4.VALUE_SOURCE, S5.VALUE_SOURCE


GO

/****** Object:  View [BwAppMap].[v_esplodi_s05_2_p]    Script Date: 10/14/2012 00:52:47 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE VIEW [BwAppMap].[v_esplodi_s05_2_p]
AS
SELECT     _tmp_ALL.S1, _tmp_ALL.S2, _tmp_ALL.S3, _tmp_ALL.S4, _tmp_ALL.S5, v_esp.ID_MAPPING, _tmp_ALL.T
FROM         BwAppMap.v_esplodi_s05_1_p AS v_esp RIGHT OUTER JOIN
                      BwAppMap.tmp_ALL_element AS _tmp_ALL ON v_esp.S5 = _tmp_ALL.S5 AND v_esp.S4 = _tmp_ALL.S4 AND v_esp.S1 = _tmp_ALL.S1 AND 
                      v_esp.S2 = _tmp_ALL.S2 AND v_esp.S3 = _tmp_ALL.S3

GO

EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[16] 4[46] 2[21] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "_tmp_ALL"
            Begin Extent = 
               Top = 6
               Left = 347
               Bottom = 189
               Right = 521
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "v_esp"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 180
               Right = 212
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 9
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'BwAppMap', @level1type=N'VIEW',@level1name=N'v_esplodi_s05_2_p'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1 , @level0type=N'SCHEMA',@level0name=N'BwAppMap', @level1type=N'VIEW',@level1name=N'v_esplodi_s05_2_p'
GO

/****** Object:  View [dbo].[v_esplodi_01]    Script Date: 10/14/2012 00:52:47 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE VIEW [dbo].[v_esplodi_01]
AS
SELECT     TOP (100) PERCENT S1.ID_MAPPING, dbo._tmp_ALL.S1, dbo._tmp_ALL.S2, dbo._tmp_ALL.S3
FROM         dbo._DATA_DWH_MODEL_ANA_MAPPING AS S1 INNER JOIN
                      dbo._tmp_ALL ON S1.VALUE_SOURCE = dbo._tmp_ALL.S1 AND S1.APPL_ID = dbo._tmp_ALL.APPL_ID INNER JOIN
                      dbo._DATA_DWH_MODEL_ANA_MAPPING AS S2 ON dbo._tmp_ALL.S2 = S2.VALUE_SOURCE AND S1.ID_MAPPING = S2.ID_MAPPING AND 
                      dbo._tmp_ALL.APPL_ID = S2.APPL_ID INNER JOIN
                      dbo._DATA_DWH_MODEL_ANA_MAPPING AS S3 ON dbo._tmp_ALL.S3 = S3.VALUE_SOURCE AND S2.ID_MAPPING = S3.ID_MAPPING AND 
                      dbo._tmp_ALL.APPL_ID = S3.APPL_ID
WHERE     (S1.FIELD_SOURCE = 'S1') AND (S2.FIELD_SOURCE = 'S2') AND (S3.FIELD_SOURCE = 'S3')
ORDER BY S1.ID_MAPPING

GO

EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[26] 4[24] 2[35] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "S1"
            Begin Extent = 
               Top = 28
               Left = 26
               Bottom = 183
               Right = 200
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "_tmp_ALL"
            Begin Extent = 
               Top = 103
               Left = 251
               Bottom = 265
               Right = 425
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "S2"
            Begin Extent = 
               Top = 4
               Left = 494
               Bottom = 112
               Right = 668
            End
            DisplayFlags = 280
            TopColumn = 3
         End
         Begin Table = "S3"
            Begin Extent = 
               Top = 162
               Left = 508
               Bottom = 270
               Right = 682
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 9
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'v_esplodi_01'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'v_esplodi_01'
GO

/****** Object:  View [dbo].[v_esplodi_02]    Script Date: 10/14/2012 00:52:47 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE VIEW [dbo].[v_esplodi_02]
AS
SELECT     TOP (100) PERCENT S1.ID_MAPPING, S1.VALUE_SOURCE AS S1, S2.VALUE_SOURCE AS S2, S3.VALUE_SOURCE AS S3
FROM         dbo._DATA_DWH_MODEL_ANA_MAPPING AS S1 INNER JOIN
                      dbo._DATA_DWH_MODEL_ANA_MAPPING AS S2 ON S1.ID_MAPPING = S2.ID_MAPPING INNER JOIN
                      dbo._DATA_DWH_MODEL_ANA_MAPPING AS S3 ON S2.ID_MAPPING = S3.ID_MAPPING
WHERE     (S1.FIELD_SOURCE = 'S1') AND (S2.FIELD_SOURCE = 'S2') AND (S3.FIELD_SOURCE = 'S3')
GROUP BY S1.ID_MAPPING, S1.VALUE_SOURCE, S2.VALUE_SOURCE, S3.VALUE_SOURCE
ORDER BY S1.ID_MAPPING

GO

EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[30] 4[32] 2[6] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "S1"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 114
               Right = 212
            End
            DisplayFlags = 280
            TopColumn = 3
         End
         Begin Table = "S2"
            Begin Extent = 
               Top = 117
               Left = 226
               Bottom = 225
               Right = 400
            End
            DisplayFlags = 280
            TopColumn = 3
         End
         Begin Table = "S3"
            Begin Extent = 
               Top = 6
               Left = 474
               Bottom = 114
               Right = 648
            End
            DisplayFlags = 280
            TopColumn = 3
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 9
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 12
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'v_esplodi_02'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'v_esplodi_02'
GO

/****** Object:  View [dbo].[v_esplodi_3]    Script Date: 10/14/2012 00:52:47 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE VIEW [dbo].[v_esplodi_3]
AS
SELECT     dbo._tmp_ALL.S1, dbo._tmp_ALL.S2, dbo._tmp_ALL.S3, dbo.v_esplodi_02.ID_MAPPING, dbo._tmp_ALL.T
FROM         dbo.v_esplodi_02 RIGHT OUTER JOIN
                      dbo._tmp_ALL ON dbo.v_esplodi_02.S1 = dbo._tmp_ALL.S1 AND dbo.v_esplodi_02.S2 = dbo._tmp_ALL.S2 AND dbo.v_esplodi_02.S3 = dbo._tmp_ALL.S3

GO

EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[41] 4[21] 2[10] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "_tmp_ALL"
            Begin Extent = 
               Top = 5
               Left = 341
               Bottom = 137
               Right = 515
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "v_esplodi_02"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 146
               Right = 212
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 9
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'v_esplodi_3'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'v_esplodi_3'
GO

/****** Object:  View [dbo].[v_esplodi_p]    Script Date: 10/14/2012 00:52:47 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE VIEW [dbo].[v_esplodi_p]
AS
SELECT     _tmp_ALL.S1, _tmp_ALL.S2, _tmp_ALL.S3, v_esp.ID_MAPPING, _tmp_ALL.T
FROM         BwAppMap.v_esplodi_s03_1_p AS v_esp RIGHT OUTER JOIN
                      BwAppMap.tmp_ALL_element AS _tmp_ALL ON v_esp.S1 = _tmp_ALL.S1 AND v_esp.S2 = _tmp_ALL.S2 AND v_esp.S3 = _tmp_ALL.S3

GO

EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[45] 4[19] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "v_esp"
            Begin Extent = 
               Top = 16
               Left = 39
               Bottom = 191
               Right = 213
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "_tmp_ALL"
            Begin Extent = 
               Top = 7
               Left = 388
               Bottom = 175
               Right = 562
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 9
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'v_esplodi_p'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'v_esplodi_p'
GO

